package me.zhengjie.business.service.impl;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.business.domain.KC22;
import me.zhengjie.business.domain.sup.Gsgl;
import me.zhengjie.business.domain.vo.Kc21Vo;
import me.zhengjie.business.domain.vo.Kc22Vo;
import me.zhengjie.business.repository.Kc21Repository;
import me.zhengjie.business.repository.Kc22Repository;
import me.zhengjie.business.service.Kc21Service;
import me.zhengjie.business.service.Kc22Service;
import me.zhengjie.business.service.dto.Kc21QueryCriteria;
import me.zhengjie.business.service.dto.Kc22QueryCriteria;
import me.zhengjie.utils.PageUtil;
import me.zhengjie.utils.QueryHelp;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @description 服务实现
 * @author xiahongbo
 * @date 2023-05-10
 **/
@Slf4j
@Service
@RequiredArgsConstructor
public class Kc22ServiceImpl implements Kc22Service {

    private final Kc22Repository kc22Repository;
    @Override
    public Map<String, Object> queryKc22VoPageList(Kc22QueryCriteria criteria, Pageable pageable) {
        Page<Kc22Vo> page = kc22Repository.queryKc22VoPageList(criteria.getAkc190(), criteria.getAkc221(), criteria.getAkc222(), criteria.getAkc223(), pageable);
        return PageUtil.toPage(page);
    }


    @Override
    public List<Kc22Vo> queryKc22VoAllList(Kc22QueryCriteria criteria) {
        return kc22Repository.queryKc22VoAllList(criteria.getAkc190(), criteria.getAkc221(), criteria.getAkc222(), criteria.getAkc223());
    }

    @Override
    public void download(List<Kc22Vo> all, HttpServletResponse response) throws IOException {

    }
}
